#ifndef __K_PID_H__
#define __K_PID_H__

#include "include.h"

typedef struct{
    u8 kp_div;//左移位数 分频
    u8 ki_div;
    s16 err;
    s16 kp;
    s16 ki;
    s16 min_output;         //Lower Limit for Output limitation
    s16 max_output;         //high Limit for Output limitation
    s16 out;
    s32 min_err;       //Lower Limit for Integral term limitation
    s32 max_err;       //high Limit for Integral term limitation
    s32 last_err;
}_PID_Struct_t;

void PID_reset(_PID_Struct_t *pid_in);
void inc_PID_update(_PID_Struct_t *pid_in, s16 err);


#endif
